/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.encapsulation.ecapsulationcomplient.hiddenclass.Impl;

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import za.ac.cput.encapsulation.ecapsulationcomplient.hiddenclass.Student;

/**
 *
 * @author given
 */
public class StudentImpl implements Student{
    private String name;
    private String surname;
    private int yearsOld;

    @Override
    public String getName() {
        return name;
    }

   
    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getSurname() {
        return surname;
    }

    @Override
    public void setSurname(String surname) {
        this.surname = surname;
    }

    @Override
    public int getYearsOld() {
        return yearsOld;
    }

    @Override
    public String toString() {
        return "Student name: " + getName() + " \nSurname: " + getSurname() + "\nSthudent age: " + getYearsOld();
    }

    @Override
    public void calculateYearsOld(int yearBorn) {
        Calendar cal = Calendar.getInstance();  
        System.out.println(cal.get(Calendar.YEAR));
        yearsOld =cal.get(Calendar.YEAR) - yearBorn;   
        
        
    }
}
